<%@page import="com.lynn.salary.util.ToolMethod"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
	String htmlbox = basePath + "htmlbox" + "/";
	String ai = "ai-" + ToolMethod.getCharAndNumr(6);
%>
<h2 class="contentTitle">发布文章</h2>
<div class="pageContent">
	<form method="post" action="<%=basePath%>article!create.do" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
		<input name="article.id" type="hidden" value="${article.id}" />
		<div class="pageFormContent nowrap" layoutH="97">
			<fieldset>
				<legend> 基本信息 </legend>
				<dl>
					<dt>文章标题：</dt>
					<dd>
						<div>
							<input name="article.title" type="text" style="width: 284px" value='<s:property value="article.title"/>'>
							<div id="showCurstatus-<%=ai %>">
								
							</div>
						</div>
					</dd>
				</dl>


				<dl>
					<dt>文章类型：</dt>
					<dd>
						<s:select name="article.type" list="articleType" cssStyle="width: 156px;" listValue="name" listKey="id">
						</s:select>
					</dd>
				</dl>

			</fieldset>
			<fieldset>
				<legend> 详细信息 </legend>
				<dl>
					<dt>提示：</dt>
					<dd>
						您可以使用  @{#附件名#}  规则插入附件,如@{#中石化股票分析#},将在文章中插入附件名称为"中石化股票分析"的附件,注意:如果找不到给定名字的附件，将不会为您转化为下载链接
					</dd>
				</dl>
				<div class="unit">
					<textarea id="<%=ai %>" class="oo" style="width:100%;height:250px;overflow:auto;word-break:break-all;" name="article.content"
						><s:property value="article.content"/></textarea>
				</div>
			</fieldset>

			<div class="formBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">保存</button>
							</div>
						</div>
					</li>
					<li>
						<div class="button">
							<div class="buttonContent">
								<button type="button" class="close">关闭</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<script>
$('#<%=ai %>').xheditor({tools:'Cut,Copy,Paste,Pastetext,|,'+
	'Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,|,'+
	'FontColor,BackColor,SelectAll,Removeformat,Align,List,Outdent,Indent,|,'+
	'Link,Unlink,Anchor,Hr,|,'+
	'Source,Preview,Print,Fullscreen,About',skin:'default',showBlocktag:true,
	internalScript:false,internalStyle:false,loadCSS:'<%=basePath %>dwz/xheditor/xheditor_skin/vista/iframe.css',
	fullscreen:false,sourceMode:false,forcePtag:true});

$.ajax({
	url:"<%=basePath %>article!showCurStatus.do?article.id=${article.id}&elemid=showCurstatus-<%=ai %>"
}).done(function(data){
	$("#showCurstatus-<%=ai %>").html(data);
});

</script>